package com.infitecs.eyas.blower.service;

import com.infitecs.eyas.blower.dao.BlowerSummaryDao;
import com.infitecs.eyas.blower.model.BlowerSummary;
import com.infitecs.eyas.session.SessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by pzw on 2015/8/29.
 */
@Service
public class BlowerSummaryService {

    @Autowired
    private SessionService sessionService;

    @Autowired
    private BlowerSummaryDao blowerSummaryDao;

    public void insertNewSummary() {
        blowerSummaryDao.insertNewSummary(sessionService.getCaseId());
    }

    public BlowerSummary getBlowerSummary() {
        return blowerSummaryDao.getBlowerSummary(sessionService.getCaseId());
    }

    public void  updateParam(BlowerSummary blowerSummary) {
        int caseId = sessionService.getCaseId();
        blowerSummary.setCaseId(caseId);
        blowerSummaryDao.updateParam(blowerSummary);
    }
}
